package com.hjp;

import java.util.Arrays;
import java.util.Scanner;
//最佳植树距离
//

public class Test3 {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNext()){
            int tree = in.nextInt();
            String str = in.nextLine();
//            int treeNum = in.nextInt();
            String[] strs = str.split(" ");
            int [] arrs = new int[tree];
            System.out.println(strs.length);
//            for (int i = 0; i < tree; i++) {
////                arrs[i] =Integer.parseInt(strs[i]);
//                System.out.print(String.valueOf(strs[i]));
//            }

            Arrays.sort(arrs);
//            String first = strs[0];
//            String last = strs[strs.length-1];
//            System.out.println(first);
//            System.out.println(last);
            for (String s : strs) {
                System.out.println(s);
            }
        }

    }
}
